package com.suptracking.dao.jpa;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;

import com.suptracking.dao.PositionDao;
import com.suptracking.entity.Position;
import com.suptracking.entity.Zone;
@Stateless
public class JpaPositionDao implements PositionDao {

	@PersistenceContext(unitName="Suptracking")
    private EntityManager em;

	@Override
	public void addPosition(Position position) {
		try {
		
			em.persist(position);
			

		}

		finally {
			
			

		}
	}

	@Override
	public void deleteAllPositionByCarId(long id) {
		
		CriteriaBuilder cb = em.getCriteriaBuilder();
        CriteriaQuery<Position> query = cb.createQuery(Position.class);
     
		
	}

	@Override
	public List<Position> getRecentPositionByCarId(long id) {
		// TODO Auto-generated method stub
		return null;
	}
	

}
